package com.luomu.base.api.cookBook.excel.bo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.luomu.base.api.cookBook.excel.utils.BigDecimalUtil;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

@ColumnWidth(15)
@HeadRowHeight(35)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
public class FinanceArApAndInvoiceInfoExcelBO implements Serializable {

    private static final long serialVersionUID = 157806235469211677L;

    @ColumnWidth(10)
    @ExcelProperty(value = {"序号"})
    private Integer no;

    /**
     * 发票号码
     */
    @ColumnWidth(30)
    @ExcelProperty(value = {"发票号"})
    private String invoiceNumber;

    /**
     * 发票金额
     */
    @ExcelIgnore
    private BigDecimal invoiceAmount;
    @ExcelProperty(value = {"发票金额"})
    private String invoiceAmountStr;

    /**
     * 开票日期
     */
    @ColumnWidth(30)
    @ExcelProperty(value = {"开票日期"})
    private Date invoiceDate;

    /**
     * 经办单位名称
     */
    @ColumnWidth(30)
    @ExcelProperty(value = {"经办单位"})
    private String purchaseUndertakeOrgName;

    /**
     * 单据名称
     */
    @ExcelProperty(value = {"单据类型"})
    private String sourceBillCateType;

    /**
     * 应付单编号
     */
    @ColumnWidth(25)
    @ExcelProperty(value = {"单据编号"})
    private String arApBillNum;

    /**
     * 应付金额
     */
    @ExcelIgnore
    private BigDecimal arApAmount;
    @ExcelProperty(value = {"单据金额"})
    private String arApAmountStr;

    /**
     * 核算往来单位BP编码
     */
    @ColumnWidth(35)
    @ExcelProperty(value = {"挂账单位（核算单位）编码"})
    private String hswlUnit;

    /**
     * 核算往来单位名称listlist
     */
    @ColumnWidth(35)
    @ExcelProperty(value = {"挂账单位（核算单位）名称"})
    private String hswlName;

    /**
     * 创建时间
     */
    @ColumnWidth(30)
    @ExcelProperty(value = {"单据录入时间"})
    private Date arApCreateTime;

    /**
     * 已付款应付金额
     */
    @ExcelIgnore
    private BigDecimal arApPaidAmount;
    @ExcelProperty(value = {"已付款金额"})
    private String arApPaidAmountStr;

    /**
     * 未付款应付应付金额
     */
    @ExcelIgnore
    private BigDecimal arApUnpaidAmount;
    @ExcelProperty(value = {"未付款金额"})
    private String arApUnpaidAmountStr;

    /**
     * 付款户名
     */
    @ExcelProperty(value = {"付款户名"})
    private String payAccountName;

    /**
     * 付款账号
     */
    @ExcelProperty(value = {"付款账号"})
    private String payAccountNo;

    /**
     * 付款金额（财务云执行记录，执行金额）
     */
    @ExcelIgnore
    private BigDecimal payAmount;
    @ExcelProperty(value = {"付款金额"})
    private String payAmountStr;

    /**
     * 付款日期
     */
    @ColumnWidth(30)
    @ExcelProperty(value = {"付款日期"})
    private Date payDate;

    /**
     * 主表经办人
     */
    @ColumnWidth(25)
    @ExcelProperty(value = {"单据录入人员"})
    private String sourceBillCreateBy;

    /**
     * 应付单摘要
     */
    @ExcelProperty(value = {"业务事由或摘要备注"})
    private String arApSummary;

    /**
     * 清洗阶段备注
     */
    @ExcelProperty(value = {"备注"})
    private String stepType;

    public Integer getNo() {
        return no;
    }

    public void setNo(Integer no) {
        this.no = no;
    }

    public String getInvoiceNumber() {
        return invoiceNumber;
    }

    public void setInvoiceNumber(String invoiceNumber) {
        this.invoiceNumber = invoiceNumber;
    }

    public BigDecimal getInvoiceAmount() {
        return invoiceAmount;
    }

    public void setInvoiceAmount(BigDecimal invoiceAmount) {
        this.invoiceAmount = invoiceAmount;
        if(invoiceAmount != null){
            this.invoiceAmountStr = BigDecimalUtil.toBigDecimalStr(invoiceAmount);
        }
    }

    public Date getInvoiceDate() {
        return invoiceDate;
    }

    public void setInvoiceDate(Date invoiceDate) {
        this.invoiceDate = invoiceDate;
    }

    public String getPurchaseUndertakeOrgName() {
        return purchaseUndertakeOrgName;
    }

    public void setPurchaseUndertakeOrgName(String purchaseUndertakeOrgName) {
        this.purchaseUndertakeOrgName = purchaseUndertakeOrgName;
    }

    public String getSourceBillCateType() {
        return sourceBillCateType;
    }

    public void setSourceBillCateType(String sourceBillCateType) {
        this.sourceBillCateType = sourceBillCateType;
    }

    public String getArApBillNum() {
        return arApBillNum;
    }

    public void setArApBillNum(String arApBillNum) {
        this.arApBillNum = arApBillNum;
    }

    public BigDecimal getArApAmount() {
        return arApAmount;
    }

    public void setArApAmount(BigDecimal arApAmount) {
        this.arApAmount = arApAmount;
        if (arApAmount != null) {
            this.arApAmountStr = BigDecimalUtil.toBigDecimalStr(arApAmount);
        }
    }

    public String getHswlUnit() {
        return hswlUnit;
    }

    public void setHswlUnit(String hswlUnit) {
        this.hswlUnit = hswlUnit;
    }

    public String getHswlName() {
        return hswlName;
    }

    public void setHswlName(String hswlName) {
        this.hswlName = hswlName;
    }

    public Date getArApCreateTime() {
        return arApCreateTime;
    }

    public void setArApCreateTime(Date arApCreateTime) {
        this.arApCreateTime = arApCreateTime;
    }

    public BigDecimal getArApPaidAmount() {
        return arApPaidAmount;
    }

    public void setArApPaidAmount(BigDecimal arApPaidAmount) {
        this.arApPaidAmount = arApPaidAmount;
        if (arApPaidAmount != null) {
            this.arApPaidAmountStr = BigDecimalUtil.toBigDecimalStr(arApPaidAmount);
        }
    }

    public BigDecimal getArApUnpaidAmount() {
        return arApUnpaidAmount;
    }

    public void setArApUnpaidAmount(BigDecimal arApUnpaidAmount) {
        this.arApUnpaidAmount = arApUnpaidAmount;
        if (arApUnpaidAmount != null) {
            this.arApUnpaidAmountStr = BigDecimalUtil.toBigDecimalStr(arApUnpaidAmount);
        }
    }

    public String getPayAccountName() {
        return payAccountName;
    }

    public void setPayAccountName(String payAccountName) {
        this.payAccountName = payAccountName;
    }

    public String getPayAccountNo() {
        return payAccountNo;
    }

    public void setPayAccountNo(String payAccountNo) {
        this.payAccountNo = payAccountNo;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
        if (payAmount != null) {
            this.payAmountStr = BigDecimalUtil.toBigDecimalStr(payAmount);
        }
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public String getSourceBillCreateBy() {
        return sourceBillCreateBy;
    }

    public void setSourceBillCreateBy(String sourceBillCreateBy) {
        this.sourceBillCreateBy = sourceBillCreateBy;
    }

    public String getArApSummary() {
        return arApSummary;
    }

    public void setArApSummary(String arApSummary) {
        this.arApSummary = arApSummary;
    }

    public String getStepType() {
        if(!Objects.equals(stepType,"3")){
            return "数据湖暂未返回应付单据";
        }else {
            return "";
        }
    }

    public void setStepType(String stepType) {
        this.stepType = stepType;
    }

    public String getInvoiceAmountStr() {
        return invoiceAmountStr;
    }

    public void setInvoiceAmountStr(String invoiceAmountStr) {
        this.invoiceAmountStr = invoiceAmountStr;
    }

    public String getArApAmountStr() {
        return arApAmountStr;
    }

    public void setArApAmountStr(String arApAmountStr) {
        this.arApAmountStr = arApAmountStr;
    }

    public String getArApPaidAmountStr() {
        return arApPaidAmountStr;
    }

    public void setArApPaidAmountStr(String arApPaidAmountStr) {
        this.arApPaidAmountStr = arApPaidAmountStr;
    }

    public String getArApUnpaidAmountStr() {
        return arApUnpaidAmountStr;
    }

    public void setArApUnpaidAmountStr(String arApUnpaidAmountStr) {
        this.arApUnpaidAmountStr = arApUnpaidAmountStr;
    }

    public String getPayAmountStr() {
        return payAmountStr;
    }

    public void setPayAmountStr(String payAmountStr) {
        this.payAmountStr = payAmountStr;
    }
}
